<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>anniu </title>
    <style>
        label{
            display: block;
            /* border: 1px solid red; */
            background-color: rgb(247, 193, 193);
            width: 100px;
            height: 30px;
            border-radius: 30px;
            position: relative;
        }
        input{
            display: none;
        }
        input:checked+span{
            color: red;
            left: 70px;

            
        }
        span{
            width: 30px;
            height: 30px;
            position: absolute;
            left:  0;
            background-color: rgb(196, 196, 196);
            border-radius: 50%;
            transition: 0.3s;
        }
    </style>
</head>
<body>
    <label for="s1">
        <input type="checkbox" id="s1">
        <span>1</span>
    </label>
    
</body>
</html>